import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';

@Component({
    selector: 'app-file-list',
    templateUrl: './file-list.component.html',
    // styleUrls: ['./file-list.component.less'],
})
export class FileListComponent implements OnInit {
    // 该组件接收的数据
    @Input() FileListData: any[];
    // 点击该组件后向父组件返回的数据
    @Output() ReturnFileData: EventEmitter<any> = new EventEmitter<any>();


    // 模拟数据
    // FileListData = [
    //     {fileId: '0000000001', fileName: '操作手册2009-EN', fileSuffix: 'pdf', fileUrl: '', uploadTime: '2020-11-01 09:15:37'},
    //     {fileId: '0000000002', fileName: '对外开发的工艺图纸', fileSuffix: 'docx', fileUrl: '', uploadTime: '2020-11-01 09:15:37'},
    //     {fileId: '0000000003', fileName: '操作手册2009-EN', fileSuffix: 'jpg', fileUrl: '', uploadTime: '2020-11-01 09:15:37'},
    //     {fileId: '0000000004', fileName: '对外开发的工艺图纸', fileSuffix: 'png', fileUrl: '', uploadTime: '2020-11-01 09:15:37'},
    //     {fileId: '0000000005', fileName: 'N', fileSuffix: 'pdf', fileUrl: '', uploadTime: '2020-11-01 09:15:37'},
    // ];

    constructor() {
    }

    ngOnInit() {
    }

    //  点击list返回该条数据
    return(data) {
        this.ReturnFileData.emit(data);
    }
}
